<!DOCTYPE html>
<html class="x-admin-sm">
    <head>
        <meta charset="UTF-8">
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="x-admin/css/font.css">
        <link rel="stylesheet" href="x-admin/css/xadmin.css">
        <script type="text/javascript" src="x-admin/js/jquery.min.js"></script>
        <script src="x-admin/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="x-admin/js/xadmin.js"></script>
        <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
        <!--[if lt IE 9]>
        <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
        <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body ">
                        <blockquote class="layui-elem-quote">欢迎
                            <% if(loginInfo.power == 1){ %>
                                管理员
                            <% }else if(loginInfo.power == 2){ %>
                                负责人
                            <% }else if(loginInfo.power == 3){ %>
                                员工
                            <% }else{ %>
                                司机
                            <% } %>
                            <span class="x-red"><%= loginInfo.nickname %></span>！当前时间:<b id="time"></b>
                        </blockquote>
                    </div>
                </div>
            </div>
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">数据统计</div>
                    <div class="layui-card-body ">
                        <% if(loginInfo.power == 1){ %>
                            <ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
                                <li class="layui-col-md3 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>用户数</h3>
                                        <p>
                                            <cite id="adminUserCount">66</cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md3 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>车辆数</h3>
                                        <p>
                                            <cite id="adminCarCount">12</cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md3 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>待审核</h3>
                                        <p>
                                            <cite id="adminApply20Count">99</cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md3 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>总申请</h3>
                                        <p>
                                            <cite id="adminApplyCount">67</cite></p>
                                    </a>
                                </li>
                            </ul>
                        <% }else if(loginInfo.power == 2){ %>
                            <ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
                                <li class="layui-col-md3 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>用户数</h3>
                                        <p>
                                            <cite id="depUserCount">66</cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md3 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>申请数</h3>
                                        <p>
                                            <cite id="depMyApplyCount">12</cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md3 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>待审核</h3>
                                        <p>
                                            <cite id="depExamApplyCount">99</cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md3 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>总申请</h3>
                                        <p>
                                            <cite id="depApplyCount">67</cite></p>
                                    </a>
                                </li>
                            </ul>
                        <% }else if(loginInfo.power == 3){ %>
                            <ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
                                <li class="layui-col-md3 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>已申请</h3>
                                        <p>
                                            <cite id="userMyApplyCount">66</cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md3 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>部门审核</h3>
                                        <p>
                                            <cite id="userDepApplyCount">12</cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md3 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>管理员审核</h3>
                                        <p>
                                            <cite id="userAdminApplyCount">99</cite></p>
                                    </a>
                                </li>
                                <li class="layui-col-md3 layui-col-xs6">
                                    <a href="javascript:;" class="x-admin-backlog-body">
                                        <h3>总申请</h3>
                                        <p>
                                            <cite id="userApplyCount">67</cite></p>
                                    </a>
                                </li>
                            </ul>
                        <% } %>
                    </div>
                </div>
            </div>
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">系统信息</div>
                    <div class="layui-card-body ">
                        <table class="layui-table">
                            <tbody>
                            <tr>
                                <th>服务器地址</th>
                                <td>x.xuebingsi.com</td>
                            </tr>
                            <tr>
                                <th>操作系统</th>
                                <td>WINNT</td>
                            </tr>
                            <tr>
                                <th>运行环境</th>
                                <td>Apache/2.4.23 (Win32) OpenSSL/1.0.2j mod_fcgid/2.3.9</td>
                            </tr>
                            <tr>
                                <th>NodeJs版本</th>
                                <td>5.6.27</td>
                            </tr>
                            <tr>
                                <th>MYSQL版本</th>
                                <td>5.5.53</td>
                            </tr>
                            <tr>
                                <th>上传附件限制</th>
                                <td>2M</td>
                            </tr>
                            <tr>
                                <th>执行时间限制</th>
                                <td>30s</td>
                            </tr>
                            <tr>
                                <th>浏览器</th>
                                <td>86015.2M</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
    </body>
    <script>
        $(function () {
            $.ajax({
                url: "count",
                method: "get",
                dataType: "json",
                success({data}) {
                    $("#adminUserCount").text(data.userCount);
                    $("#adminCarCount").text(data.carCount);
                    $("#adminApply20Count").text(data.apply20Count);
                    $("#adminApplyCount").text(data.applyCount);
                    $("#depUserCount").text(data.userCount);
                    $("#depMyApplyCount").text(data.myApplyCount);
                    $("#depExamApplyCount").text(data.examApplyCount);
                    $("#depApplyCount").text(data.applyCount);
                    $("#userMyApplyCount").text(data.myApplyCount);
                    $("#userDepApplyCount").text(data.depApplyCount);
                    $("#userAdminApplyCount").text(data.adminCount);
                    $("#userApplyCount").text(data.applyCount);
                }
            });
            setTime();
            setInterval(setTime, 1000);
        })

        function setTime() {
            const time = new Date().toLocaleString();
            $("#time").text(time);
        }
    </script>
</html>
